package com.kkang.ch2.prepost;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

/**
 * @author yongk_liu
 **/
@Configuration
@ComponentScan("com.kkang.ch2.prepost")
public class PrePostConfig {

    @Bean(initMethod = "init", destroyMethod = "destroy")
//注入对象没有声明，调用时直接指定
    DemoBeanWayService beanWayService() {
        return new DemoBeanWayService();
    }

    @Bean
//注入的bean已经注解了开始结束方法，无需指定直接注入即可
    DemoJSR250WayService jsr250WayService() {
        return new DemoJSR250WayService();
    }

}
